home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / screenf.cq / screenf.c
Text File  |  1985-09-03  |  1KB  |  48 lines

  1. /**
  2. *        This is a set of routines to print data to the screen.
  3. *        There are functions to do it using the BIOS int 10H
  4. *        and an additional one print_memory to do it by moving
  5. *        data directly to screen memory.
  6. **/
  7.  
  8. #include <dos.h>
  9. #include <attrib.h>
  10. #define  NULL 0
  11.  
  12. /**
  13. *        place cursor on the screen
  14. *        format : int row, col;
  15. *                 set_curpos(row, col);
  16. *
  17. **/
  18. set_curpos (row, col)
  19. int row, col;
  20.  
  21. {
  22.     union REGS regs;
  23.  
  24.     regs.h.ah = 02;          /* move cursor request */
  25.     regs.h.bh = 00;          /* page 0              */
  26.     regs.h.dh = row;
  27.     regs.h.dl = col;
  28.  
  29.     int86 (0x10, ®s, ®s);
  30. }
  31. /**
  32. *        get current cursor position
  33. *        format    :    int row, col;
  34. *                       get_curpos(&row,&col);
  35. *
  36. **/
  37. get_curpos(row, col)
  38. int *row, *col;
  39. {
  40.  
  41.     union REGS regs;
  42.  
  43.     regs.h.ah = 03;
  44.     regs.h.bh = 00;
  45.     int86 (0x10, ®s, ®s);
  46.     *row = regs.h.dh;
  47. 
  48. on REGS regs;